package com.qidian.buy.item.config;

import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

import java.time.Duration;

/**
 * Author: 戴着假发的程序员
 * Date: 2024-05-13 12:09
 * company: 起点编程
 **/
@Configuration
public class RestTemplateConfig {
    @Bean
    public RestTemplate restTemplate(RestTemplateBuilder builder){
        builder.setReadTimeout(Duration.ofMillis(6000));
        builder.setConnectTimeout(Duration.ofMillis(6000));
        return builder.build();
    }
}
